package org.jianfa.learn.dubbo.provider.impl;

import org.jianfa.learn.dubbo.api.HelloService;

import java.util.concurrent.TimeUnit;

public class HelloServiceImpl implements HelloService {

    @Override
    public String methodA() {
        try {
            long timeout = Math.round(Math.random() * 100);
            TimeUnit.MILLISECONDS.sleep(timeout);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "Hello MethodA";
    }

    @Override
    public String methodB() {
        try {
            long timeout = Math.round(Math.random() * 100);
            TimeUnit.MILLISECONDS.sleep(timeout);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "Hello MethodB";
    }

    @Override
    public String methodC() {
        try {
            long timeout = Math.round(Math.random() * 100);
            TimeUnit.MILLISECONDS.sleep(timeout);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "Hello MethodC";
    }
}
